<template>
  <div class="home">
    <p>{{ num }}</p>
    <p>{{ number }}</p>
    <button @click="ab">++</button>
    <button @click="cd">++</button>
  </div>
</template>

<script>
import { mapState, mapActions} from "vuex";
export default {
  name: "Home",
  components: {},
  computed: {
    ...mapState({
      num: state => state.a.count,
      number: state => state.b.count,
    })
  },
  methods: {
    // ...mapActions(['a/coutAdd','b/coutAdd']),
    ...mapActions('b', {
      ab: 'coutAdd'
    }),
    ...mapActions('a', {
      cd: 'coutAdd'
    }),
    // add(){
    //   this.coutAdd()
    // }
  },
};
</script>
